<template>
	<view class="online_service">
		<view class="os_content">
			<view class="" v-for="(item,index) in arr" :key="index">
				{{item}}
			</view>
		</view>
		<view class="os_bottom">
			<tm-input  placeholder="请输入您要咨询的问题" v-model="content" right-icon='icon-plus-circle-fill' @click='test'></tm-input> 

			</tm-icons>
		</view>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arr:[],
				content:''
			}
		},
		onLoad() {
			this.getMsg()
		},
		methods: {
			test(){
				if(this.content.length>0){
					// this.arr.push(this.content)
					
					let msg= this.content
					this.socket.emit('message',msg)
					this.content=''
					
				}
			},
			getMsg(){
				this.socket.on('hello',msg=>{
					console.log('aaaaaa',msg)
					this.arr.push(msg)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.online_service{
	width: 100%;
	height: 100%;
	.os_bottom{
		// display: flex;
		min-width: 100%;
		position: fixed;
		bottom: 0;
	}
}
</style>
